#include "map/MapLocation.h"
#include "util/ByIdMatcher.h"

MapLocation::MapLocation(std::string id, MapLocationType type, RoadSegment* roadSegment, int height) {
	this->setId(id);
	this->setType(type);
	this->setRoadSegment(roadSegment);
	this->setHeight(height);
}

MapLocation::~MapLocation() { }

std::string MapLocation::getId() {
	return this->id;
}

std::string MapLocation::getRoadName() {
	return this->roadSegment->getRoad()->getName();
}

int MapLocation::getHeight() {
	return this->height;
}

MapLocationType MapLocation::getType() {
	return this->type;
}

MapPoint MapLocation::getPosition() {
	return this->roadSegment->getPointAt(this->getHeight());
}

double MapLocation::getAngle() {
	return this->roadSegment->getAngle();
}

bool MapLocation::equals(MapLocation* other) {
	return this->getId() == other->getId();
}

void MapLocation::setId(std::string id) {
	this->id = id;
}

void MapLocation::setHeight(int height) {
	this->height = height;
}

void MapLocation::setType(MapLocationType type) {
	this->type = type;
}
